<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>

import {mapGetters} from 'vuex'
export default {
  name: 'App',
  components: {},
  data(){
    return{
      isRouterAlive:true,
      myArticleOrWrite:''
    }
  },
  provide(){
    return{
      reload:this.reload
    }
  },
  computed:{
    ...mapGetters('LoginModule',['getStatus']),
  },
  mounted() {
    if (!this.getStatus){
      console.log("刷新")
      localStorage.removeItem('user')
    }
  },
  methods:{
    reload(){
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    }
  }
}
</script>

<style>
  *{
    margin: 0;
    padding: 0;
  }
</style>
